package com.hqd.test;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.fastjson.JSON;
import com.hqd.test.cglib.MyClass;
import com.hqd.test.cglib.MyMethodInterceptor;
import com.hqd.test.event.*;
import com.hqd.test.observe.Fans1;
import com.hqd.test.observe.Fans2;
import com.hqd.test.observe.GieGie;
import com.hqd.test.spel.Expression;
import com.hqd.test.spel.ExpressionParser;
import com.hqd.test.spel.ReformRuleContext;
import com.hqd.test.spel.accessor.ReformExpressionContextAccessor;
import com.hqd.test.spel.context.StandardEvaluationContext;
import com.hqd.test.spel.parse.ChineseExpressionParser;
import net.sf.cglib.proxy.Enhancer;
import org.junit.Test;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Arrays;
import java.util.Properties;
import java.util.Random;

public class Main {
    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(MyClass.class);
        enhancer.setCallback(new MyMethodInterceptor());

        MyClass myClassProxy = (MyClass) enhancer.create();
        myClassProxy.sayHello();
    }

    // 计算绿色像素所占比例，传入参数为图片的文件路径
    public static String calculateGreen(String image) throws Exception {

        File file = new File(image);
        BufferedImage bi = null;
        try {
            bi = ImageIO.read(file);
        } catch (Exception e) {
            e.printStackTrace();
        }

        //长宽
        int width = bi.getWidth();
        int height = bi.getHeight();

        //横纵坐标起始点
        int minx = bi.getMinX();
        int miny = bi.getMinY();

        //绿色像素点个数
        long greenNumber = 0;
        int[] rgb = new int[3];// 定义RGB空间
        float[] hsv = new float[3];// 定义HSV空间
        // 开始遍历所有像素点
        for (int i = minx; i < 1000; i++) {
            for (int j = miny; j < height; j++) {

                // 当前像素点
                int pixel = bi.getRGB(i, j);

                // 获取RGB各值
                rgb[0] = (pixel & 0xff0000) >> 16;//R
                rgb[1] = (pixel & 0xff00) >> 8;//G
                rgb[2] = (pixel & 0xff);//B

                Color.RGBtoHSB(rgb[0], rgb[1], rgb[2], hsv);
                //使用hsv判断该像素点是否可以判定为绿色像素点
                if (hsv[2] >= 0.556 && hsv[2] <= 0.996
                        && hsv[1] >= 0.125 && hsv[1] <= 0.704
                        && hsv[0] >= 0.0516 && hsv[0] <= 0.136) {
                    greenNumber++;
                }
            }
        }

        // 总像素点个数
        long totalPixelNumber = width * height;

        // 获取浮点数表示的占比
        double greenPixelProportion = (double) greenNumber / totalPixelNumber;

        // 返回百分制字符串
        return translateDoubleIntoPercent(greenPixelProportion);
    }

    /**
     * 将浮点数转换为百分制
     *
     * @param d
     * @return
     */
    public static String translateDoubleIntoPercent(double d) {
        BigDecimal bDecimal = new BigDecimal(d);
        bDecimal = bDecimal.setScale(4, BigDecimal.ROUND_HALF_UP);
        DecimalFormat dFormat = new DecimalFormat("0.00%");
        String result = dFormat.format(bDecimal.doubleValue());
        return result;
    }

    public static boolean isFullWidth(String str) {
        if (str == null) {
            return false;
        }
        return str.matches("[\\uFF00-\\uFFEF\\u3000-\\u303F]+");
    }

    @Test
    public void tx() throws Exception {
        Properties properties = new Properties();
        properties.setProperty("druid.driverClassName", "com.mysql.cj.jdbc.Driver");
        properties.setProperty("druid.url", "jdbc:mysql://localhost:3306/spring?useSSL=false&serverTimezone=UTC");
        properties.setProperty("druid.username", "root");
        properties.setProperty("druid.password", "root");

        DruidDataSource dataSource = new DruidDataSource();
        dataSource.configFromPropety(properties);

        String sql = "UPDATE user SET name = ?,age=?,sex=? WHERE id = ?";
        Connection connection = null;
        PreparedStatement preparedStatement = null;

        try {
            connection = dataSource.getConnection();
            //关闭自动提交
            connection.setAutoCommit(false);
            preparedStatement = connection.prepareStatement(sql);
            preparedStatement.setString(1, "ls");
            preparedStatement.setInt(2, new Random().nextInt(100));
            preparedStatement.setString(3, "nv");
            preparedStatement.setInt(4, 11);
            preparedStatement.executeUpdate();
            connection.commit();
        } catch (Exception e) {
            e.printStackTrace();
            connection.rollback();
        } finally {
            if (preparedStatement != null) {
                preparedStatement.close();
            }
            if (connection != null) {
                connection.close();
            }
        }
    }

    @Test
    public void imageSplit() throws Exception {
        String originalImg = "E:\\工作\\信雅达\\录入切片系统\\需求文档\\中央公务卡申请表-AF4808-09-18-21_01.jpg";
        // 读入大图
        File file = new File(originalImg);
        BufferedImage originalImage = ImageIO.read(file);
        int startX = 940;
        int cropWidth = originalImage.getWidth() - startX;

        // 使用裁剪后的宽度创建空白图片
        BufferedImage croppedImage = new BufferedImage(cropWidth, originalImage.getHeight(), BufferedImage.TYPE_INT_RGB);

        // 绘制原始图片的右侧到裁剪后的图片中
        croppedImage.createGraphics().drawImage(
                originalImage.getSubimage(startX, 0, cropWidth, originalImage.getHeight()),
                0, 0, null);

        ImageIO.write(croppedImage, "jpg", new File("E:\\工作\\信雅达\\录入切片系统\\需求文档\\test.jpg"));

    }

    @Test
    public void timeTest() {
        LocalTime nextDayNine = LocalTime.of(9, 0);
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime nextDayNineDateTime = now.plus(1, ChronoUnit.DAYS).with(nextDayNine);
        DateTimeFormatter simpleDateFormat = DateTimeFormatter.ofPattern("yyyyMMdd hh:mm:ss");
        System.out.println("次日9点：" + nextDayNineDateTime.format(simpleDateFormat));
    }

    @Test
    public void spelTest() {
        String json = "{\"bankNo\":\"\",\"operDetail\":{\"nodeName\":\"CPS\"},\"organNo\":\"999999\",\"process\":{\"flowId\":\"\"},\"systemNo\":\"\",\"transInfo\":{\"businessInfo\": {    \"CPS\": {        \"AUDIT\": {            \"RESULT\": {                \"FLAG\":\"\",                \"REASON\":\"\"                },            \"SECTYPE\": {                \"ORGANNO\":\"\"                },            \"VCRNUM\":\"\",            \"ZUPTAMT\":\"\"            },        \"CASEID\":\"20220526_47_16_8E9D245F-A37B-128A-A2CC-2C063051E217-1\",        \"FIELDS\": {            \"FIELD_NODE\": [                        {                    \"CODE\":\"BillPostAddress\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"3\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"2\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"0\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"2\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"0\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"0\"                    },                        {                    \"CODE\":\"OtherContactsFullName\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"3\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"2\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"2\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"MainCardEffectiveStartEndTime\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"Sex\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"3\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"2\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"0\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"0\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"2\",                        \"OPERID\":\"6003\",                        \"VALUE\":\"0\"                        },                    \"VALUE\":\"0\"                    },                        {                    \"CODE\":\"MainCardNativePlace\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"MarryStatus\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"1\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"1\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"1\"                    },                        {                    \"CODE\":\"HouseProvince\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"HouseCity\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"HouseRegion\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"HouseAddrLine\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"HousePostcode\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"MobilePhone\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"HousePhone\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"RelImmediateFamilyAndApplicant\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"8\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"8\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"8\"                    },                        {                    \"CODE\":\"CarNo\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"Email\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"CompanyName\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"EmployStatus\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"6\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"6\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"6\"                    },                        {                    \"CODE\":\"Department\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"CountryOrRegion\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"1\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"1\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"1\"                    },                        {                    \"CODE\":\"Nationality\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"STP\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"STP\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"STP\"                    },                        {                    \"CODE\":\"CardType\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"6\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"6\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"2\"                    },                        {                    \"CODE\":\"Other\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"OtherContactsHouseProvince\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"OtherContactsCityOfHouse\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"OtherContactsHouseRegion\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"OtherContactsHouseAddress\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"OtherContactsEmail\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"PressFlowerName\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"CardNo\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"123\"                    },                        {                    \"CODE\":\"Birthday\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"EducationLevel\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"3\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"3\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"3\"                    },                        {                    \"CODE\":\"HouseUsePurpose\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"1\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"1\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"1\"                    },                        {                    \"CODE\":\"OtherExplain\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"CompanyProvince\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"CompanyCity\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"CompanyRegion\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"CompanyAddress\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"CompanyPostcode\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"RelationOfContactsAndApplicant\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"3\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"8\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"2\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"8\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"2\",                        \"OPERID\":\"6003\",                        \"VALUE\":\"8\"                        },                    \"VALUE\":\"8\"                    },                        {                    \"CODE\":\"OtherContactsCompanyName\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"OtherContactsPhoneNo\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"OtherContactsTelePhoneNo\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"AuthRepaymentCard\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"FillingTime\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"MarketingCode\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"OriginCode\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"UnionCode\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"SubBankSiteCode\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"PvasUv\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"0\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"0\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"0\"                    },                        {                    \"CODE\":\"MainCardHKAndMacaoPassNo\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"CompanyPhone\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"CompanyProperty\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"0\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"0\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"0\"                    },                        {                    \"CODE\":\"ECIFProfession\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"200\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"200\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"200\"                    },                        {                    \"CODE\":\"CurrentCompanyJoinTime\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"IncomeOfYearlySalary\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"GetIncomeIsOrNotAutoTransAcc\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"9\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"9\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"9\"                    },                        {                    \"CODE\":\"OtherIncomeOfYearly\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"GiveCardOrgan1\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"C\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"C\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"C\"                    },                        {                    \"CODE\":\"GoldCommonMark1\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"Q\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"Q\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"Q\"                    },                        {                    \"CODE\":\"ProductNo1\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"072\"                    },                        {                    \"CODE\":\"CardStyle\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                    },                        {                    \"CODE\":\"IsApplication\",                    \"NULLABLE\":\"0\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"1\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"1\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"1\"                    },                        {                    \"CODE\":\"CNName\",                    \"NULLABLE\":\"1\",                    \"STATUS\":\"0\",                    \"USER1\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6002\",                        \"VALUE\":\"\"                        },                    \"USER2\": {                        \"AUTOSTART\":\"1\",                        \"ERRORVALUE\":\"0\",                        \"OPERID\":\"6001\",                        \"VALUE\":\"\"                        },                    \"USER3\": {                        \"AUTOSTART\":\"\",                        \"ERRORVALUE\":\"\",                        \"OPERID\":\"\",                        \"VALUE\":\"\"                        },                    \"VALUE\":\"\"                        }                    ]            },        \"ISPASS\":\"\",        \"NOTE\":\"字段问题件\",        \"RECOGNITION\": {            \"ORGANNO\":\"\",            \"SECTYPE\":\"\",            \"TRADELIST\": {                \"TRADE\": {                    \"AREAID\": {                        \"CODE\":\"\",                        \"FIELD\": {                            \"CODE\":\"\",                            \"VALUE\":\"\"                            },                        \"LOCATION\":\"\"                        },                    \"FORMATID\":\"\",                    \"NAME\":\"\",                    \"SEALCHECK\":\"\",                    \"TYPE\":\"\"                    },                \"VOUCHNAME\":\"\"                },            \"VOUCHGROUP\":\"\"            },        \"STATUS\":\"3\"            }        }},\"transNo\":\"WMA2100\",\"userNo\":\"CPS\"}";
        ExpressionParser parse = new ChineseExpressionParser();
        ReformRuleContext reformRuleContext = new ReformRuleContext(JSON.parseObject(json));
        StandardEvaluationContext context = new StandardEvaluationContext(reformRuleContext);
        context.addPropertyAccessor(new ReformExpressionContextAccessor());
        /**
         * 若字段值为空值，则赋值999999
         *  字段值为空，则赋值全角“X”
         *   字段录入值为空，则赋值00
         *   若字段有‘?’，第332个字段赋值"4"；
         *
         * 当 -> if(
         * 时 -> )
         *
         *   1、当证件种类=0且录入值不为0时，则赋值0;
         *   2、当证件种类=2时，录入值不为1则赋值1;
         *   3、当证件种类=3时，录入值不为2则赋值2;
         *   4、当证件种类1或7时，录入值不为3则赋值3;
         *   5、当证件种类=8时，录入值不为9则赋值9;
         *   6、当产品编号1在 (072，094，089，126，133) 时，录入值不为0则赋值0
         */
        String[] es = {"当证件种类='0'，且证件号码不为'0'时，证件号码赋值0;子银行赋值5454;" +
                "或当证件种类='2'，且证件号码不为'1'时，证件号码赋值1,子银行赋值88888;" +
                "或当产品编号1在 ('072','094','089','126','133')中，且证件号码不为0时，证件号码赋值666;" +
                "当加入公司日期为空时，加入公司日期赋值999;" +
                "当产品编号1不在('091','133','089','126')中，且公司电话!=7时，公司电话赋值4"};
        Arrays.stream(es).forEach(ex -> {
            Expression expression = parse.parseExpression(ex);
            System.out.println("表达式：" + ex);
            System.out.println(String.format("产品编号1：%s，证件种类：%s",
                    reformRuleContext.getFieldCodeByCnName("产品编号1").get("VALUE"),
                    reformRuleContext.getFieldCodeByCnName("证件种类").get("VALUE")));
            System.out.println("证件号码原值：" + reformRuleContext.getFieldCodeByCnName("证件号码").get("VALUE"));
            System.out.println("加入公司日期原值：" + reformRuleContext.getFieldCodeByCnName("加入公司日期").get("VALUE"));
            System.out.println("公司电话原值：" + reformRuleContext.getFieldCodeByCnName("公司电话").get("VALUE"));
            System.out.println("############################################################################");
            expression.getValue(context);
            System.out.println("证件号码目标值：" + reformRuleContext.getFieldCodeByCnName("证件号码").get("VALUE"));
            System.out.println("加入公司日期目标值：" + reformRuleContext.getFieldCodeByCnName("加入公司日期").get("VALUE"));
            System.out.println("公司电话目标值：" + reformRuleContext.getFieldCodeByCnName("公司电话").get("VALUE"));
            System.out.println("子银行目标值：" + reformRuleContext.getFieldCodeByCnName("子银行").get("VALUE"));

            reformRuleContext.setFieldCodeValByCnName("证件号码", "");
        });

    }


    @Test
    public void event() {
        GieGie gieGie = new GieGie();
        GieGieEventPublisher publisher = new GieGieEventPublisher();
        //添加粉丝
        FansListener1 fans1 = new FansListener1();
        FansListener2 fans2 = new FansListener2();
        FansListener3 fans3 = new FansListener3();
        publisher.addListener(fans1);
        publisher.addListener(fans2);
        publisher.addListener(fans3);

        gieGie.setMsg("发布专辑");
        publisher.publishEvent(new ReleaseAlbumsEvent(gieGie));
        System.out.println("######################################");
        gieGie.setMsg("爆出绯闻");
        publisher.publishEvent(new ScandalEvent(gieGie));
    }

    @Test
    public void observe() {
        GieGie gg = new GieGie();
        Fans1 fans1 = new Fans1();
        Fans2 fans2 = new Fans2();
        gg.addObserver(fans1);
        gg.addObserver(fans2);

        gg.doSomething("发布了新专辑");
        System.out.println("######################################");
        gg.doSomething("爆出了绯闻");
    }

}
